package com.infore.authorityManagement.dto;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javax.persistence.Column;

/**   
 * @ClassName:  Menu   
 * @Description:封装菜单对象，返回给客户端   
 * @author: thb 
 * @date:   2018年11月1日 下午4:20:22   
 */
public class Menu implements Comparable<Menu> {

	private static final long serialVersionUID = 1L;
	
	private String id;
	
	private String parentId;
	
	private String name;
	
	private String label;		//配合前端 展示，显示菜单名称
	
	private String url;
	
	private Integer level;
	
	private Integer seqNum;
	
	private String appCode;
	
	private String appName;
	
	private String img;
	
	private Integer type;
	
	private Integer checked;
	
	private boolean disabled;	//配合前端展示，显示是否已经拥有权限
	
	private Integer itemChecked;
	
	private List<Menu> children = new ArrayList<>();
	
	private String description; // 描述

	private Integer status; // 是否开放 0暂未开放 1或null 默认开放

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getParentId() {
		return parentId;
	}

	public void setParentId(String parentId) {
		this.parentId = parentId;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public Integer getLevel() {
		if (level == null) {
			level = 0;
		}
		return level;
	}

	public void setLevel(Integer level) {
		this.level = level;
	}

	public Integer getSeqNum() {
		if (seqNum == null) {
			seqNum = 0;
		}
		return seqNum;
	}

	public void setSeqNum(Integer seqNum) {
		this.seqNum = seqNum;
	}

	public String getAppCode() {
		return appCode;
	}

	public void setAppCode(String appCode) {
		this.appCode = appCode;
	}

	public String getAppName() {
		return appName;
	}

	public void setAppName(String appName) {
		this.appName = appName;
	}

	public List<Menu> getChildren() {
		return children;
	}

	public void setChildren(List<Menu> children) {
		this.children = children;
	}
	
	public String getImg() {
		return img;
	}

	public void setImg(String img) {
		this.img = img;
	}

	public Integer getType() {
		if (type == null) {
			return 0;
		}
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public Integer getChecked() {
		return checked;
	}

	public void setChecked(Integer checked) {
		this.checked = checked;
	}

	public String getLabel() {
		return label;
	}

	public void setLabel(String label) {
		this.label = label;
	}

	public boolean isDisabled() {
		return disabled;
	}

	public void setDisabled(boolean disabled) {
		this.disabled = disabled;
	}

	public Integer getItemChecked() {
		return itemChecked;
	}

	public void setItemChecked(Integer itemChecked) {
		this.itemChecked = itemChecked;
	}

	public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    @Override
	public int compareTo(Menu o) {
		if (this.seqNum > o.getSeqNum()) {
            return 1;
        } else {
            return -1;
        }
	}
	
}
